package com.bw.product.service.impl;

import com.bw.common.security.utils.SecurityUtils;
import com.bw.model.LoginUser;
import com.bw.product.domain.vo.UserAttrDiscountCouponVo;
import com.bw.product.mapper.UserAttrDiscountCouponMapper;
import com.bw.product.service.UserAttrDiscountCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserAttrDiscountCouponServiceImpl implements UserAttrDiscountCouponService {
    @Autowired
    private UserAttrDiscountCouponMapper userAttrDiscountCouponMapper;


    /**
     * 用户优惠列表
     *
     * @param state
     * @return
     */
    @Override
    public List<UserAttrDiscountCouponVo> list(Integer state) {
        //获取登录用户信息
        LoginUser loginUser = SecurityUtils.getLoginUser();
        Long userid = loginUser.getUserid();
        return userAttrDiscountCouponMapper.list(userid,state);
    }
}
